//
//  GXCommonTravelInfomationViewCell.m
//  YIChuSeller
//
//  Created by 田小椿 on 2018/12/5.
//  Copyright © 2018年 xiangshengjun. All rights reserved.
//

#import "GXCommonClientMessageCell.h"
@interface GXCommonClientMessageCell()
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *stateLabel;
@property (weak, nonatomic) IBOutlet UILabel *dinnerLabel;
@property (weak, nonatomic) IBOutlet UILabel *tabelLabel;
@property (weak, nonatomic) IBOutlet UIImageView *logoImageView;
@end
@implementation GXCommonClientMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//    self.photoImage.layer.masksToBounds = YES;
//    self.photoImage.layer.cornerRadius = 20;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setClientDict:(NSDictionary *)clientDict
{
    _clientDict = clientDict;
    NSString *url = [NSString stringWithFormat:@"%@/%@",kBaseURLIMAGE,clientDict[@"logo"]];
    [self.logoImageView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"placeHolder_userLogo"]];
    self.nameLabel.text = clientDict[@"name"];
    NSString *imagestr = [clientDict[@"sex"] isEqualToString:@"0"] ? @"ord_sexboy":@"ord_sexgirl";
    self.sexImageView.image = [UIImage imageNamed:imagestr];
    self.stateLabel.text = [self fromOrderStateGetString:clientDict[@"state"]];
    NSString *timeStr = [clientDict[@"periodTime"] isEqualToString:@"1"] ? @"晚上":@"中午";
    self.dinnerLabel.text = [NSString stringWithFormat:@"%@  %@",clientDict[@"orDate"],timeStr];
    self.tabelLabel.text = [NSString stringWithFormat:@"%@号桌  %@人",clientDict[@"tabNum"],clientDict[@"peopleNum"]];
}

- (NSString *)fromOrderStateGetString:(NSString *)str
{
    if ([str isEqualToString:@"0"]) {
        return @"待接单";
    }else if ([str isEqualToString:@"1"]){
        return @"已接单";
    }else if ([str isEqualToString:@"2"]){
        return @"已取消";
    }else if ([str isEqualToString:@"3"]){
        return @"已拒单";
    }
    return nil;
}

@end
